<h2 class="title3" style="width: 95%">
	新闻管理
	<%= link_to(image_tag("add.gif"),"/content/add_news", :title => "添加新闻") %>
</h2>
<table>
	<tr class="tab">
		<th width="40" align="center">序号</th>
		<th width="120" align="center">标题</th>
		<th width="120" align="center">创建时间</th>
		<th width="120" align="center">分类</th>
		<th width="120" align="right">操作</th>
	</tr>
 	<% @news.each_with_index do |news, index| %>
		<tr onmouseover="this.className='cur_tr';" onmouseout="this.className='';" class="">
			<td align="center" class="number"><%= (index + 1) + (params[:page].to_i * 10) %></td>
			<td><%= link_to news.title, news_path(news), :title => news.title %></td>
		  <td align="center"><%= news.created_at.strftime("%Y-%m-%d %H-%M-%S") %></td>
			<td align="left"><%= categories_tag(news) %></td>
			<td align="right">
				<%= link_to image_tag("modify.gif"), {:controller => :content, :action => :edit_news,:id => news.id}, {:title => "修改"} %>
				<%= link_to image_tag("destroy.gif"), {:controller => :content, :action => :destroy_news,:id => news.id},{:confirm => "确定删除？", :title => "删除 #{news.title}"} %>
			</td>
		</tr>
 	<% end %>
	<% if @news.page_count > 1 %>
		<tr><td colspan="3"><%= will_paginate @news %></td></tr>
	<% end %>
</table>
